package com.photography.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

@TableName("serial")
public class Serial implements Serializable {
    @TableId(type = IdType.INPUT)
    private  String         id;            //  套系ID
    private  String         serialname;    //  套系名称
    private  BigDecimal     serialprice;   //  套系价格
    private  Integer        status;        //  状态。 可选值:1(启用),0(禁用)
    private  String         categoryid;    //  分类ID
    private  String         includeproduct;
    private String           note;
    private Date created;   // 创建时间
    private Date updated;   // 更新时间

    @TableField(exist = false)
    private String statusString;

    @TableField(exist = false)
    private List<Order> orders;

    @TableField(exist = false)
    private List<Product> products;
    @TableField(exist = false)
    private List<String> productIds;

    public String getNote() {
        return note;
    }

    public void setNote(String note) {
        this.note = note;
    }

    public String getStatusString() {
        if (this.getStatus() != null){
            if (this.getStatus() == 1){
                return "正常";
            }else if (this.getStatus() == 0){
                return "<span style=\"color:red;\">下架</span>";
            }
        }
        return "";
    }

    public void setStatusString(String statusString) {
        this.statusString = statusString;
    }

    public String getIncludeproduct() {
        return includeproduct;
    }

    public void setIncludeproduct(String includeproduct) {
        this.includeproduct = includeproduct;
    }


    public String getIncludeorder() {
        return includeproduct;
    }

    public void setIncludeorder(String includeorder) {
        this.includeproduct = includeorder;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getSerialname() {
        return serialname;
    }

    public void setSerialname(String serialname) {
        this.serialname = serialname;
    }

    public BigDecimal getSerialprice() {
        return serialprice;
    }

    public void setSerialprice(BigDecimal serialprice) {
        this.serialprice = serialprice;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getCategoryid() {
        return categoryid;
    }

    public void setCategoryid(String categoryid) {
        this.categoryid = categoryid;
    }

    public Date getCreated() {
        return created;
    }

    public void setCreated(Date created) {
        this.created = created;
    }

    public Date getUpdated() {
        return updated;
    }

    public void setUpdated(Date updated) {
        this.updated = updated;
    }

    public List<Order> getOrders() {
        return orders;
    }

    public void setOrders(List<Order> orders) {
        this.orders = orders;
    }

    public List<Product> getProducts() {
        return products;
    }

    public void setProducts(List<Product> products) {
        this.products = products;
    }

    public List<String> getProductIds() {
        return productIds;
    }

    public void setProductIds(List<String> productIds) {
        this.productIds = productIds;
    }

    @Override
    public String toString() {
        return "Serial{" +
                "id='" + id + '\'' +
                ", serialname='" + serialname + '\'' +
                ", serialprice=" + serialprice +
                ", status=" + status +
                ", categoryid='" + categoryid + '\'' +
                ", created=" + created +
                ", updated=" + updated +
                ", orders=" + orders +
                ", products=" + products +
                '}';
    }
}
